# Contributor: Bart Ribbers <bribbers@disroot.org>
# Maintainer: team/kde <bribbers@disroot.org>

# The group tag is just to easily find this APKBUILD by some scripts for automation
# group=kde-applications
pkgname=step
pkgver=24.02.2
pkgrel=0
# armhf blocked by extra-cmake-modules
# s390x blocked by
# riscv64 disabled due to missing rust in recursive dependency
arch="all !armhf !s390x !riscv64"
url="https://edu.kde.org/step/"
pkgdesc="Interactive Physics Simulator"
license="GPL-2.0-or-later AND GFDL-1.2-only"
makedepends="
	eigen-dev
	extra-cmake-modules
	kconfig-dev
	kcrash-dev
	kdoctools-dev
	kiconthemes-dev
	knewstuff-dev
	kplotting-dev
	qt6-qtbase-dev
	qt6-qtsvg-dev
	qt6-qttools-dev
	samurai
	shared-mime-info
	"
subpackages="$pkgname-doc $pkgname-lang"
_repo_url="https://invent.kde.org/education/step.git"
source="https://download.kde.org/stable/release-service/$pkgver/src/step-$pkgver.tar.xz"

build() {
	cmake -B build -G Ninja \
		-DBUILD_WITH_QT6=ON \
		-DCMAKE_BUILD_TYPE=RelWithDebInfo \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib
	cmake --build build
}

check() {
	ctest --test-dir build --output-on-failure
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}

sha512sums="
35d6df48c97dc13f3247673706a37ad64c3bbc25dfc65a8e3364363563f6df31f60e66ab97ee6c3f78017ff93e66e77781cd421bf43a8f26823e6631781212b1  step-24.02.2.tar.xz
"
